<div class="panel panel-default">
    <style>
        .panel-body .row{
            margin: 5px;
        }
    </style>
    <div class="panel-heading">

        <form class="search-form form-inline">
            <div class="form-group">
                <label>
                    <a>系统管理</a>
                    &nbsp;>>
                    <a>系统设置</a></label>
            </div>
            &nbsp;
        </form>

    </div>
    <iframe style="display: none" name="ifr" id="ifr"></iframe>
    <div class="panel-body">
        <div class="table-responsive">
            <form enctype="multipart/form-data" target="ifr" action="{:url($act)}" method="post">
                <div class="row">
                    <div class="col-md-2">后台站点标题</div>
                    <div class="col-md-6">
                        <input type="text" name="side_admin_title" value="{$info.content.side_admin_title}" class="form-control">
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-2">前台台站点标题</div>
                    <div class="col-md-6">
                        <input type="text" name="side_home_title" value="{$info.content.side_home_title}" class="form-control">
                    </div>
                </div>

                <div class="row">
                    <div class="col-md-2">首页幻灯片</div>
                    <div class="col-md-6">
                        {for start="0" end="3" step="1" name="k"}
                        <div class="row">
                            <span class="btn btn-info" style="display: inline-block;width: fit-content;">
                                <span>选择图片</span>
                                <span style="opacity: 0;display:inline-block;position: absolute;left: 0;">
                                    <input class="file-uploader" type="file" name="slide[]" id="slide_{$k}" >
                                </span>

                            </span>
                            <span>
                                <img id="slide_img_{$k}" style="height: 100px;margin-left: 20px" src="{if isset($info['content']['slide'][$k])}{$info['content']['slide'][$k]}{/if}" alt="">
                            </span>
                        </div>
                        <p></p>
                        {/for}
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-2"></div>
                    <div class="col-md-6">
                        <input type="hidden" name="_ajax" value="1">
                        <input type="hidden" name="id" value="{$info.id}">
                        <input type="hidden" name="act" value="{:url($act)}">
                        <input type="hidden" name="req_sub" value="1">
                        <button type="submit" class="ajax-btn btn btn-info">保存</button>
                    </div>
                </div>

            </form>
        </div>
    </div>
</div>

<!-- 文件上传 -->
<script src="__STATIC__/plugins/uploader/js/vendor/jquery.ui.widget.js"></script>
<script src="__STATIC__/plugins/uploader/js/jquery.iframe-transport.js"></script>
<script src="__STATIC__/plugins/uploader/js/jquery.fileupload.js"></script>
<!-- 文件上传 -->
<script>

    $(function () {
        var frame = $(document).find('#ifr')[0];
        frame.addEventListener('load',function (e) {
            var data = JSON.parse(frame.contentWindow.document.body.textContent);
            if(data.code == 1){
                successMsg(data.msg);
                if(data.url){
                    $.post(data.url,{},function (page) {
                        setTimeout(function () {
                            $('#layout_content').html(page);

                        },1000);
                    });
                }
            }else{
                errorMsg(data.msg);
            }
        });
        imgPreview('#slide_0','#slide_img_0 ');
        imgPreview('#slide_1','#slide_img_1 ');
        imgPreview('#slide_2','#slide_img_2 ');
    });
</script>